package priv.dajie.tzzq.bot.model;

import java.util.ArrayList;
import java.util.HashMap;

public class SteamTradeHistorys extends ArrayList<SteamTradeHistory> {
    private HashMap<String, SteamTradeHistory> IDMap = null;

    public synchronized HashMap<String, SteamTradeHistory> getIDMap(){
        if(IDMap == null){
            IDMap = new HashMap<>();
            for(SteamTradeHistory steamTradeHistory : this){
                IDMap.putIfAbsent(steamTradeHistory.getListingid(), steamTradeHistory);
            }
        }
        return IDMap;
    }


}
